<template>
	<view>
		<view class="d-flex  j-sb p-1 border main-text-color font">


			<block v-if="tabbarArrayType==2">
				<view class="center ">
					工单编号
				</view>
				<view class="center " @tap="changeType">
					<text>{{xunjianType}}</text>
					<image src="../../static/icon/icon6.png" mode=""></image>
				</view>
				<view class="center " @tap="changeXunJianStatus">
					<text>{{xunjianStatus}}</text>
					<image src="../../static/icon/icon6.png" mode=""></image>
				</view>
			</block>
			<block v-else>
				<view class="center ">
					工单编号
				</view>
				<view class="center ">
					提报人
				</view>
				<view class="center ">
					<text>状态</text>
					<image src="../../static/icon/icon6.png" mode=""></image>
				</view>
			</block>
		</view>
		<view class="flex_new">
			<view class="d-flex   main-text-color_2 font flex-1 border-bottom pd_n" v-for="(item,index) in list"
				:key="index" @tap="showDtail">
				<block>
					<view class="center">
						{{item.id}}
					</view>
					<view class="center">
						{{item.name}}
					</view>
					<view class="center ">
						{{item.address}}
					</view>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				//巡检员  巡检类型全部选择
				xunjianTypeArr: ['分配路线', '报警路线'],
				//巡检员  巡检类型
				xunjianType: '类型', 
				//巡检员  巡检类型全部选择
				xunjianStatusArr: ['已完成', '进行中'],
				//巡检员  巡检类型
				xunjianStatus: '所属状态',
				list: [{
					id: 100012,
					name: '张三',
					status: 1
				}, {
					id: 100013,
					name: '张三001',
					status: 1
				}, {
					id: 100014,
					name: '张三001',
					status: 2
				}, {
					id: 10001,
					name: '张三',
					status: 2
				}, {
					id: 10001,
					name: '张三',
					status: 3
				}, {
					id: 10001,
					name: '张三',
					status: 3
				}, {
					id: 10001,
					name: '张三',
					status: 2
				}, {
					id: 10001,
					name: '张三',
					status: 2
				}, {
					id: 10001,
					name: '张三',
					status: 2
				}, {
					id: 10001,
					name: '张三',
					status: 2
				}]
			}
		},
		methods: {
			//巡检员 类型选择
			changeType() {
				uni.showActionSheet({
					itemList: this.xunjianTypeArr,
					success: (res) => {
						this.xunjianType = this.xunjianTypeArr[res.tapIndex]
					},
					fail(res) {
						console.log(res.errMsg)
					}
				})
			},
			//巡检员 状态选择
			changeXunJianStatus() {
				uni.showActionSheet({
					itemList: this.xunjianStatusArr,
					success: (res) => {
						this.xunjianStatus = this.xunjianStatusArr[res.tapIndex]
					},
					fail(res) {
						console.log(res.errMsg)
					}
				})
			},
			//巡检员  跳转
			//维保单位 详情跳转
			showDtail() {
				if(this.tabbarArrayType==2){
					uni.navigateTo({
						url:'../route_detail/route_detail'
					})
				}else{
					uni.navigateTo({
						url: '../user_listDetail/user_listDetail'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 20rpx;
		height: 14rpx;
		margin-left: 8rpx;
	}

	.flex_new {
		height: calc(100vh - 210rpx);
	}

	.flex_new>view {
		padding: 36rpx 0;
		display: flex;
		align-items: center;
	}

	.build_bttom_page {
		width: 100%;
		position: fixed;
		box-sizing: border-box;
		bottom: 0rpx;
		box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1);
	}

	.center {
		flex: 1;
		text-align: center;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
</style>
